﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Data.SqlClient;

namespace Db
{
    public class PersonDb : AbstractDb
    {

        public Person GetPersonNamesByID(int id)
        {
            Person person = null;
            SqlDataReader q = this.db.Query("SELECT * FROM Bif_Person WHERE person_ID = " + id);
            if (q.HasRows && q.Read())
            {
                string fName = q.GetString(q.GetOrdinal("movie_title"));
                string lName = q.GetString(q.GetOrdinal("movie_instructor"));
                person = new Person(id, fName, lName);
            }
            return person;
        }
    }
}
